function debounce(fn,remain=100){
    let timer=null
    return function (){
        if(timer){
            clearTimeout(timer)
        }
        const args=arguments
        const context=this
        timer=setTimeout(() => {
            fn.call(context,...args)
        }, remain);
    }
}